<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>百慧wms仓库</title>
    <link href="layui/css/layui.css" rel="stylesheet">
    <link rel="stylesheet" href="css/hxx-login.css">
    <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="img/ico/favicon.ico" />
</head>
<body style="background-color: #f7fafc;">

    <div class="layui-container">
        <div class="layui-row login">
            <div class="login-left">
                <div class="user-in">
                    <h2>百惠WMS后台管理系统</h2>
                    <form class="form layui-form">
                        <input class="layui-input" type="tel" value="18288888888" name="userTel" placeholder="手机号"/>
                        <input class="layui-input" type="password" name="password" placeholder="密码"/>
                        <div class="layui-input" style="width: 90%;display: flex;">
                            <input type="text" name="vc" placeholder="验证码" style="border: none;width: 120px;"/>
                            <img id="vc" src="/getVerifyCode">
                        </div>
                        <button  lay-submit lay-filter="login" class="layui-btn layui-btn-normal layui-btn-fluid">登录</button>
                    </form>
                </div>
            </div>
            <div class="login-right">
                <img src="img/bg.svg">
            </div>
        </div>
    </div>

<script src="layui/layui.js"></script>
<script src="js/hxx.js"></script>
<script>

    layui.use(["jquery","form","layer"],function () {
        let $ = layui.jquery;
        let form = layui.form;
        let layer = layui.layer;
        form.on('submit(login)', function(data){
            $.ajax({
                url:"login",
                method:"post",
                contentType:"application/json",
                data:JSON.stringify(data.field),
                dataType:"json",
                success:function (d) {
                    console.log(d);
                    if(d.code===0){
                        location.href="/";//跳转首页
                    }else{
                        layer.msg(d.msg);
                    }
                }
            });
            return false;
        });
    });

</script>
</body>
</html>